package com.miyake.loveviewweb.server.controller;

import org.slim3.controller.Controller;
import org.slim3.controller.Navigation;

import com.miyake.rest.LicenseType;
import com.miyake.rest.ServiceType;
import com.miyake.rest.Value;
import com.miyake.rest.WebServiceProperty;
import com.miyake.rest.Value.SubUnit;

public class AnalysisTestController extends Controller {

    @Override
    public Navigation run() throws Exception {
        if (this.isGet()) {
            WebServiceProperty prop = new WebServiceProperty();
            prop.setServiceName("Analysis Test");
            prop.setCompanyUrl("http://localhost");
            prop.setDescription("Test Web Service");
            prop.setLicenseType(LicenseType.Free);
            prop.setProvider("MIYAKE.COM");
            prop.setServiceType(ServiceType.Analyzer);
            prop.setServiceUrl(this.basePath+"/analysisTest");
            prop.getValues().add(new Value("splice", "Splice Loss", "0.2", SubUnit.None, "dB"));
            prop.getValues().add(new Value("refl", "Reflectance", "50.0", SubUnit.None, "dB"));
            prop.getValues().add(new Value("end", "End", "50.0", SubUnit.None, "dB"));
            this.response.getWriter().print(prop.toXML());
        }
        else if (this.isPost()) {
            
        }
        
        return null;//forward("analysisTest.jsp");
    }
}
